import request from '@/utils/request'

// 查询订单商品明细列表
export function listOrderItems(query) {
  return request({
    url: '/order/orderItems/list',
    method: 'get',
    params: query
  })
}

// 查询订单商品明细详细
export function getOrderItems(orderItemId) {
  return request({
    url: '/order/orderItems/' + orderItemId,
    method: 'get'
  })
}

// 新增订单商品明细
export function addOrderItems(data) {
  return request({
    url: '/order/orderItems',
    method: 'post',
    data: data
  })
}

// 修改订单商品明细
export function updateOrderItems(data) {
  return request({
    url: '/order/orderItems',
    method: 'put',
    data: data
  })
}

// 删除订单商品明细
export function delOrderItems(orderItemId) {
  return request({
    url: '/order/orderItems/' + orderItemId,
    method: 'delete'
  })
}

  // 通过商品ID查找对应的商品对象
export function selectArtGoodByGoodId(goodId) {
  return request({
    url: '/order/orderItems/good/' + goodId,
    method: 'get'
  })
}
